Skip to content

fix(data-grid): distinguish literal string 'NULL' from SQL NULL in TableMutationEngine WHERE clause - #1385

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1368-distinguish-null-literal-in-where
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1368-distinguish-null-literal-in-where

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1368

Summary

  • In TableMutationEngine._buildWhereClause, check if column type is a text column (_isTextType) before treating string 'NULL' or 'null' as SQL NULL.
  • Use kNullSentinel to unambiguously identify genuine SQL NULL in row across primary key matches and unkeyed fallback matches.
  • Preserves literal string 'NULL' as WHERE col = 'NULL' in UPDATE and DELETE statements for text columns, preventing accidental corruption or deletion of unintended rows.
  • Added regression tests in test/core/database/table_mutation_engine_test.dart.

@github-actions github-actions Bot added bug Something isn't working stability Theme parser epic label: stability data-grid Interactive data grid, cell editor, filtering, groupings backend Backend database driver execution and queries P1 High priority / Core capability labels Oct 10, 2026
generatePlan passed only columnDataTypes to _buildWhereClause, so callers
supplying types via columnMeta got no text-type detection and the literal
string 'NULL' was still rendered as IS NULL.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit fcd2dc9 into dev Oct 10, 2026
15 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1368-distinguish-null-literal-in-where branch October 11, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend database driver execution and queries bug Something isn't working data-grid Interactive data grid, cell editor, filtering, groupings P1 High priority / Core capability stability Theme parser epic label: stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant